const express = require('express');
const { registerUser, loginUser, getUserById } = require('../controllers/userController');
const { protect } = require('../middleware/auth');

const router = express.Router();

// 注册用户
router.post('/register', registerUser);

// 用户登录
router.post('/login', loginUser);

// 获取用户信息
router.get('/:id', protect, getUserById);

module.exports = router; 